<template>
  <div>
    <tables   :tableCofig="tableConfig" ref="tables"  v-model="tableData" :columns="columns" @on-delete="handleDelete"/>
  </div>
</template>

<script>
import Tables from '_c/tables'

export default {
  components: {
    Tables
  },
  data () {
    return {
      tableConfig:{
          border:true,
          stripe:true,
          editable:true,
          dataAPi:'',
          editApi:'',
          delApi:'',
          addApi:'',
          loading:false,
          noDataText:'暂无企业信息',
      },
     
      columns: [
        {title: '名称',width:120, key: 'companyName',fixed:'left'},
        {title: '法人',key: 'legalPerson', editable: true},
        {title: '地址', key: 'compaynAddress',tooltip:true,ellipsis:true},
        {title: '电话', key: 'phone'},
        {title:'E-Mail',key:'email',hidel:true},
       
        {title: '订单数', key: 'totalOrder'},
        {title: '可用信用额',key: 'money',render: (h, params) => {
              return h('a', {
                    props: {
                        color: "",
                    },  
               },params.row.money-usMoney);
        }},
        {title: '累计交易额', key: 'totalOrderMoney',hidel:true},
        {title: '累计里程', key: 'totalkm',hidel:true},
        {title: '折扣', key: 'discount'},
        {title: '同城计费', key: 'wideCityFormula'},
        {title: '城际计费', key: 'interCityFormula'},
        {title: '一口价', key: 'fixedPrice'},
        {title: '企业状态', key: 'checkStatus'},
        {title: '创建时间',key: 'createTime',hidel:false},
        {title: '创建人', key: 'createBy'}
      
      ],
      tableData: []
    }
  },
  methods: {
    handleDelete (params) {
      console.log(params)
    },
    exportExcel () {
      this.$refs.tables.exportCsv({
        filename: `table-${(new Date()).valueOf()}.csv`
      })
    }
  },
  mounted () {
   
  }
}
</script>

<style>

</style>
